package com.teach.basic.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import com.teach.basic.service.impl.MerchantServiceImpl;
import com.teach.basic.model.po.Merchant;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 交易表 前端控制器
 * </p>
 * @version 1.0
 * @author hzz
 * @since 2020-02-18
 */
@RestController
@RequestMapping("/merchant")
public class MerchantController {
    @Autowired
    private MerchantServiceImpl serviceMerchant;

    @RequestMapping("/index")
    public String fun(HttpServletRequest request,HttpServletResponse response){
        return "ok";
    }
    @RequestMapping("/list")
    public List<Merchant> getList(){
        Map<String,Object> param=null;
        return serviceMerchant.getList(param);
    }
    @RequestMapping("/save")
    public boolean save(@RequestParam("entity") Merchant entity){
        return serviceMerchant.saveOrUpdate(entity);
    }
    @RequestMapping("/delete")
    public boolean delete(@RequestParam("id")String id){
        return serviceMerchant.removeById(id);
    }
}

